package com.abl.controller.system;

import com.abl.common.security.annotation.ResC;
import com.abl.common.security.annotation.ResM;
import com.abl.domain.model.Param;
import com.abl.domain.model.SRS;
import com.abl.controller.BaseController;
import com.abl.service.system.TemplateService;
import com.alibaba.fastjson2.JSONObject;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@ResC("模板管理")
@Tag(name = "模板管理")
@RestController
@RequestMapping("/system/template")
public class TemplateController extends BaseController {
    @Autowired
    private TemplateService service;

    @ResM("默认表格新增")
    @PostMapping({"/table/default/add"})
    public SRS<Object> defaultTableAdd(@RequestBody Param<JSONObject> param) {
        return SRS.bySuccess(service.defaultTableAdd(param));
    }

    @ResM("默认表格删除")
    @PostMapping({"/table/default/del"})
    public SRS<Object> defaultTableDel(@RequestBody Param<JSONObject> param) {
        return SRS.bySuccess(service.defaultTableDel(param));
    }

    @ResM("默认表格修改")
    @PostMapping({"/table/default/edit"})
    public SRS<Object> defaultTableEdit(@RequestBody Param<JSONObject> param) {
        return SRS.bySuccess(service.defaultTableEdit(param));
    }

    @ResM("默认表格查询集合")
    @PostMapping({"/table/default/list"})
    public SRS<Object> defaultTableList(@RequestBody Param<JSONObject> param) {
        return SRS.bySuccess(service.defaultTableList(param));
    }

}
